cleanup regarding state variables