data extraction and vector construction