make recursion cleaner