WIP on database filtering