Refactored partial view code