Minor refactor and added Heuristic calculation on state creation