Refactor functions as operations