Prepare data for tables