Refactoring. Config should be autowired and non static. Scan package is used in xml configuration.