refactor cont'd