add helper function to build title names and implement in layout