code improved for BeanLoader class