Refactored ToolListener with annotations and fixed tests