refactored due to move of pkgtool to std/felix
refactored due to change in syntac for match of variant types