Reorganize model
Add record class
Remove unused code from tests