add gitignore and refactoring