basic entity/state system