Refactored boilerplate