Add default format and refactor isValid into separate methods