Patient page UI, refactoring