move pid conversion to its own file