Refactored method extractor. Added test for method extractor.