improve specs code