Simplify normalize function