Refactor according to PSR1 and PSR2