Changed document entity info from Map to object, other small improvements