moved regexp and formatting into the module