some little refactoring