optimized MethodInfoExtractor

removed double loop and replaced by inner loop
makes it run smoothly and fast