Refactor delete component