Cleanup extract_stages