Improve utils.normalize() and utils.denormalize()