added .gitignore, refactoring