Added gitignore
Fixed refactoring error
Made script a standalone module