Adding database functionality and selective model runs