Refactor using PSR1/PSR2 rules

All tests ok