refactoring. improved javassist generator