Some refactoring and add of .gitignore