Use data->pad instead of pad for 'object'. Reduce indentation depth in a helper with an early return.