ifdef'ed worker functions