Read data and create basic data structures