Extract options type-checking to separate file