efactoring of mongodb host selector

Change-Id: Ic5a334364afcd3673d1353db3685025e9da40b97