extracting method for recursion