improved BeanLoader code