refactoring out common code