Move rgk to own file