getExistingUserID helper method

+formatting changes since trailing space removal is now automated in files I change.