cleaned up MainActivity class