fix refactoring issues