move cleanup things from functions to includes