Update Registration.php

I have cleaned codes and refactored the class with an eye on PSR-0/1/2 code conventions