Adapting code to PSR-2