completes refactor