Minor refactoring + added typed non-entity test for Criteria API