extracted validation to separate class