Add class method function