rearranging code in models and medical page.