# Cleaning up your flows

## Aligning nodes

The selected nodes can be aligned to the top, bottom, right or left by using the using **shift-w/a/s/d**

* **shift-w** - align top
* **shift-s** - align bottom
* **shift-a** - align left
* **shift-d** - align right

## Distribute nodes

The selected nodes can be distributed vertically or horizontally using **shift-q/e**.

* **shift-q** - distribute horizontally
* **shift-e** - distribute vertically

## Aligning arrows

You can also align on arrows, which means moving the nodes it connects to so that the line becomes level. To do this, select a node and use either **shift-w** to move the bottommost node up, or **shift-s** to move the topmost node down.

{% embed url="<https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRdFpuRAnTVYgmlCXLLou%2Fuploads%2FXTy6Kd5hfBfeGcQrS0ew%2FClipboard-20250327-194005-434.mp4?alt=media&token=7eed0dd2-3a34-41a3-8688-68c116f3efd7>" %}

## Group nodes by converting them to a function

Selected nodes can be converted to a reusable function by right clicking one of the selected nodes and clicking 'Convert to function'. The nodes will then be moved to a function (which you can give a custom name) and replaced by an instance of that function. Any arrows to and from those nodes will be automatically hooked up, and the behavior of your application stays intact.
