Moved cache to internals of get_next_move