Refactoring / cleaning code