Removed options and parameters validation code duplication