invoke the correct method