Split vis. code into smaller functions.