Cleanup. Attempted join caching, but needs some rework.