Boilerplate refactoring