move some default logic from schema to lib