Hacking VE's tool implementation for reuse.