Introduce state object

**do not review yet**