decoupled routing functions from onsuccess