Breaking out sgetpwent into multiple functions