factored out commons, added version number and state to entity