Updated routing to use closures