Factory validates for non empty code and title