Using module design pattern inside a function doesn't really help.