fix refactoring errors