Code simplification

Several commits to simplify the code

devurandom:feature/strict-aliasing should be merged first.