Fix regex and clean up