updated for PSR-2 and PSR-4