move hide logic to template