Ugly load_ref method. Tests pass.
adapt
Command form