Improved inline docu and some refactorings