These changes should be reviewed by @ranbena because they was implemented to save memory thought