Refactor templated controls