Delete button jquery method refactored (thanks Mihai)