get rid of some reinterpret_cast operators to avoid memory alignment issues