change instance methods to class methods and change specs