Refining regex and other code bits.