refactor csv import, moved logic from controller to the manager