work on refactor