refactor(scripts): minor refactors and code conventions