refactor day