Refactor async spells code