a bit refactoring for open formula UI ++ some bugfixes