move parsing of stage to seperate method