Refactoring in preparation for extension of tool