pull out some common functionality
start on CV function