Extracting xctool logic to objects