Bean factory example