optimize routes definition