isDeterministic refactoring