I'd suggest to extract this condition into separate method which will simplify the condition and the code in new methods, since you will not repeat this nasty ```@options[:formats].flatten```