The pharmacy giant has been working to streamline operations and focus on more profitable locations.