minor refactoring - no changes to logic