Refactoring and estetic changes to the code.