Refactored SecondaryDataHandler to implement factory pattern