extract into ClassMethods module.