Code cleaning/refactoring