bean factory example