Refactored some code
Added a ignore patterns option