Deep refactoring before we add more logic to support quarters and cache.