refactored code path