added Extract Method function