refactor string joining
remove duplicate attr definition