Minor refactoring to avoid errors with other sripts and libraries