added flexible upgrade system for entites