Implemented PatternGenerator class and moved create_pattern to PatternGeneratorIndexed