Proper refactoring