refactors domain and record access