Move the `div` into a partial and move the entire `if` block into a helper