Simplify the code, no need for all those intermediate variables
Differential Revision: https://phabricator.kde.org/D15034