refactor gradient model selection framework