Code refactored according to PSR-2