The document presents a technique for automatically restructuring functions with low cohesion into functions with higher cohesion. It does this by partitioning the output variables of a function based on their pairwise cohesion, as measured by rules that encode principles of cohesion discovered by previous research. Program slicing is then used to identify statements computing each variable group, and new functions are created from these slices to replace the original function. The technique aims to decompose functions into natural units of activity, as a human programmer would, in order to improve understandability and maintainability.