Move non-oneliner functions out of RefPtr class declaration