#74 Code cleanup and refactor (PSR-1/2)