class to method