day 4 refactor