Store RC in a magic object

Please review and merge if it's ok.