changed deprecated BeanFactory and added a property for Triangle