Setup logic, probably will change soon