Use mapping api instead of accessing data directly.

@elioschmutz 
i think we should use the dict api here, otherwise the object changes are not registered, which could be dangerous.