Use callback for create queue and update queue, Remove $.each function