Refactoring; improved doc;