remove template, refactor download and fix compareRecords