improving function to clone repo