Refactored TagType to be an enum. Added more tests