Hi Marc,
Yes it's ok to move this section, to avoid code duplication. functions.js is cached in the browser so the downside of increased size is minimal.