Refactor with a debug target