Make commmand router a function instead of object