better removal of regex