code cleanup and code style (PSR-2) fixes

beginning of fixing code to conform with PSR-2