Better doc, add logger option, slight refactoring