Add automatic routing into prepare_space