Refactoring multi tenancy aspect.