fix refactor errors