Final refactoring and added a Test Web App.