WIP: rework attribute, query and table