Clean up main script organization
Better iteration