extract methods to a class