Move plan retrieval into the gen_server.