Only save variables that are needed