remove bean factory