Clean up shadow declarations and unused variable