Re-arranged setup script