modularised shared code for RequireJS config