Speed patch and cleanup

-Compile patterns in a list comp for later use
-Remove unused imports
-Clarify some log messages