CODE: move code with side effects out of assert() for readability