Some refactoring on the manager + comments.