Attempts at refactoring. Build failed