revised structure to use nested structure