Refactor suffix finding method.