re-structure package so that there is a clear separation between extract and analysis phases