move localizeBody outside of a function and use a variable handler