refactor for