a tool to maintain invariants during refactoring