Code cleaning for tests