DRY refactoring