probably we should use the bean factory