Refactoring some agent classes (I)