extract method from validate