some refactor of webapp and startup of webapp