Refactoring scheme checking when using from(...)