I'm looking at Apache POI to parse some Excel files. What I could see so far is that there are HSSF\* classes to deal with xls and XSSF\* for xlsx files.  

I need to read some rather complicated data pattern from the first sheet of a workbook.

So the question is: do I have to code the same logic twice for both xls and xlsx formats or can I work with both in a more universal way?