factor different type instances into their own classes