refactor code for roles and add data for tags