cleaned up funcs.js module