remove deprecated Record.client, and do some refactoring
small refactorings