Migrate new account code into self contained directive.