Added method to register custom methods.