refactored base