quick bug fix and little refactoring