Remove multiple re imports and use re.compile()