Added __init__ function in base class to avoid code repetition