A little refactoring
Works again after refactor breaking.
Merge branch 'netbeans'