last step refactor