code cleanup. move variables to the preprocess