bugfix, a little refactoring, callback functionality