tweaks to UI to externalize common functionality into directives