switch to a nested structure format for easier lookups