changing api - pass the require function as first parameter