Refactor isVisible