pull some sv processing code out of build_connection

into a new function process_sv