Improve beforeValidate