split script into classes