reorganize order of update/rendering