Add support for functions and schema selection