refactoring, bugfixing NCApp4