Webapp big refactor

#348
code formatting