move endianess conversion out of core