Cheatsheet visibility code refactored.

Cheatsheet visibility code refactored.