Refactors tag creation