Extract logic for hiding or showing elements and for displaying profile rows

1 job for refactor-manual-review in 1 minute and 11 seconds