move and genericize removeTaskFromList