Move some helpers to new format, fix router bug