Refactoring of schemes