[Attribute] Convert into generic to add compile additional safety

#5