Added a new java path, some other refactoring

I could not resist the temptation to do some further changes ;-). If you want I can create separate pull requests.