Error checking and moved shutil methods into seperate subroutine for clarity