Cleanups and modifications for recursive category tree