refactor secret creation to model
refactor error list to a set

this get rid of the need to uniquify the errors array over and over