Make class for type and use it