Moved app code from index.html