minor refactoring to main runner code simplifying conditional