cleans up old files and updates link reference