Added .gitignore and refactored a bit