slight refactoring of util/vm/build.py to make it more extensible