little refactoring in several class