Added webapp and some refactorings