split off workers & resize function, for reusability