better comments and variable names
moved regex definitions out of loop into closure