moved contructing retine code into new constructor and changed all code for constructing retine to call the new constructor