generic builder for all models