various webapp and controller refactoring