refactor for component