Reorganize scope variables for tests