Refactoring of the contract functionality