# Backbone Marionette code improvement 2

How could this code be improved and have fewer repeated lines?

vent.on("createAccountLayout:rendered", function() {
logger.info('createAccountLayout:rendered => CreateAccountLayoutController');
showRegion(['phoneNumberRegion', 'keyboardRegion', 'nextRegion', 'quitRegion']);

vent.trigger('createAccountLayout:setToNumericKeyboard');
});

vent.on('createAccountPhoneNumberView:nextStep', function() {
closeRegion(['phoneNumberRegion', 'keyboardRegion', 'nextRegion']);
showRegion(['nameRegion', 'keyboardRegion', 'nextRegion']);

vent.trigger('createAccountLayout:setToAlphaNumericKeyboard');
vent.trigger('createAccountLayout:disableNextButton');
});

• If the code isn't that repetitive or that many, I suggest you leave it be. This is too little for a generic routine to be created. – Joseph May 23 '13 at 2:52
• Noted. Though while coding this module, I realized that there's going to be more of those. So I want to simplify this before things gets out of hand. – user1966211 May 23 '13 at 3:00
• As far as I remember, I have answered a question of yours that holds the same pattern. You can apply a similar approach. – Joseph May 23 '13 at 3:07