Better method of getting base path.