repository creation logic