Code cleanup and tested app.