Move some files out of client into model.