Prior to refactoring as function