refactor & delete functionality