Refactor + doc fix