Defining segments and metrics