fixing bad regex and improve another