Not sure if it is bad to ``require`` inside a function like this. Certainly abnormal. Why not ``require`` at the top?