Extract class into file