added app wrapper and cleaned up <script> block