[ticket/12408] Code cleanup

Rebased to see if travis will finally play along

PHPBB3-12408