refactoring (DRY)