clean codes and add test case for route

Change-Id: I54fcd5a7e6aa3e410a73fe842f8779c9a8cd79fc