Changed function cleanup