code clean up for nitro callback