route function needs review