grid generation becomes external module