Restructure source for clarity between actual refactoring commands and
API for writing them