simplify get_bytes, 15% speedup