Refactoring

File and record deleting now extracted to seperate method.