added general gitignore for java, fixes and refactoring