refactor: null -> undefined where appropriate