Removed unneeded testing to reduce clutter
Brought code to PSR2