updated with dependency injection with spring @Autowired