Refactoring: removing connections between nodes and introducing Controller classes.