WIP: working on query layer