[states] move IO logic outside the repository subclass This is meant to lighted this part a bit
Pierre-Yves David