Hooking up the entity wrapper and cleaning up.