Extracted input normalization function