organizing main and detail page for the data