Improved logic for hijacking @specialized