Better state handling