Refactor test and SandboxEnvironment instantiates itself