neater refactoring