updated code to PSR-2