Move file movement to seperate function