Delete Function, code cleaning