Fixed bug in EPUM instance state handling

De-duped state comparision code to simplify