refactor of homework03