Clean up regex usage a bit