decouple constructor and setData, so setData can be overridden without impacting constructor