#3 more refactoring