move to bean factory