use more sensible return value order