moved method in connection class