query optimization, removal of unused files