Improve autowire navigation code