modularized the queue model