Refactoring for smartlab tenant with test