refactor handling of records to fix some test failures under
elixir v0.10.1