Fixed delete rendering issue, refactored a little bit