Refactoring by converting code fragments into reusable functions.