Cleaning & refactoring