index/update/delete implementation + cleanup