Tasks: Cleaning up code complexity for saving and importing tasks