little refactoring, removed warnings