Improved doc, did some refactoring