Removed generator from PatternIntervalGenerator & did code cleanup

Mostly code cleanup.