Bit of refactoring. Prob want to change this so you have to set all unique attributes in one go.