move deserialization of rank to Rank class