some refactoring issues