New state database type and generator function
remove old 'find state' function