Changing method to object type