statebox refactor