added utility methods, redid handle_inst to use them