improve class related fn