cleanup before generating pages