Rearranged the details pages, cleaned up some code, fixed warnings