Adapt to new api
resolve merge
Resolve second merge