Refactor of new code
Added test on RouteProperties
and fixed the bug that they turned up