refactor backend queue