I think it is better to move this indexOf(text, pattern) out of VKmer and make a new class for it, maybe StringMatch... When you try to use it in our GA, pass parameters. Since you have made KMP algorithm to static, it is the same to make a new container. But a new class is clear.