remove isStateFinal method, use state.getType().isFinal() instead