Remove if-end block when copying files