prepare method