fixed refactoring issues