Starting to move spin logic to the backend