Ditch the flatten() implementation