Removing scripting duplication