little refactoring to increase code quality