Big refactor from an afternoon of tripling