Remove unused definitions.
Use same code piece to concatinate state update functions.