Refactor for compatibility with older compilers.