middle of refactor