refactor with components