Refactoring saas module