extract getBasePath method from getBasePathSelector