Changed over to use a reference class