Enhance regular expression to handle more poolname separators
Replace while-loop with for-each loop.  Thank you intellij
Make changes from code review suggestions
Make variables private