Refactored checking and getting of pattern files into functions
Fixed checking and getting functions and moved them into plugin folder