ldb: controls marshalling/unmarshalling improvement