Partly states implementation, a bit of refactor