Refactoring of autowire extension