Refactor sandbox helper API