Replaced the compatibility class with a conditional method call.