Organizing the code a bit to be ready for different variants of how to create segments