added new logic to populate routes properly instead of lumping as gateway

Ref #757