Refactor add component