refactoring repository creation script