Refactor to components