GPII-271: Two identical functions combined into showOrHideDependingOnState