Put logic from GUI into DBConnector. Other GUI changes