do some refactoring work