2nd refactor