Cleaning up router 'waitOn' function.