Cleaning/Consolidating/Tunning FILES table database code