refractored to code to add in def const