use class in getBean method