Changed the Connection class to a inner class within MainActivity