base: more generic state handling