finish insert_class functions