Refactor hierarchy to avoid recursion

People found the recursive implementation confusing.