use template if instead of hidden?=; refactor