Cleaned up callout generation code