refactor normalized grid generation into a utility function.
Refactor of normalized grid generation.