shifted from class to instance variables
cut down duplicated code