Improve queue model, need some tests