code clean up with parameters: now validate is part of parameters definition