don't use unless with else
cleaned up connection class a little