small optimization
simplify
simplify state merge