refactored helpers