Rewrote the code to follow PSR-1 standards