Refactor task launching to be a bit cleaner