clean-up in functions.js