move flatten to settings