Rework data IO into factory pattern - only for img input right now