Refactored web app to make it work with tomcat