Split the AutoRouter into separate files.
Added optional custom error message.