Some refactoring done to make code simpler
Refactored some methods, added misc files to gitignore