basic modularization of update and queue functions