better service namespace extraction