move all components of Register code to Directives