More backend refactoring