Split helper stuff into a separate file.