fix bug if repo name contains dots, some refactoring