move code for preparing stealth output to stealth module.