refactor listbyTag function, #14