apply only necessary state changes