Additional refactoring separating out common behavior