Refactor to fragments.