Started moving /lib code into anon function