enhanced the regexps and cleaned things up