full refactor of criteria classes for performance