refactoring to ensure we DRY