Refactored scripts to use base class