REV: code optimization again