Share more code between backends