a bit of refactoring
remove useless endianess conversion