Refactoring/cleaning code