Import only what is needed
Move functions to let
Matching multiple patterns
Do all checks with regex