Add roles reformat function to controller