move all normalization into the normalize function

Change-Id: I7c3837d32e9e9689e884cff4fb18c0b8bbecffb3