added refs class, removed type vector (not tested)