refactor the web app