Refactor, use script queue instead of todo list