WIP: some optimizations to criteria