refactoring get class info method extracted.