use ref so we can use as_bytes()