Defining stages as classes