Factor dataset conversion out into separate class