Added gitignore
Some refactorings