toolkit.Manipulate: organize code