Initial draft of setRefClass function