More refactoring of tags controller