add check version available method,and do some refactorings