set up switch statement for function cleanup to be dropped into