initial implementation of refs