cache the type of o so it's not called multiple times.