Refactoring the framework script