Refactoring and added gitignore