added application class, simplified main.js