bugfix + refactoring + gitignore