dvoa: reorganize code to make it run better