Clean-up and refactoring for consistency (scripts)