Various refactoring. Added delete method