slight refactoring on test and records code