Refactor API calls into action and info