replaced manual lowercasing with regex