use underscore.js for undefined checks
better readbility, no effective changes