TODO: rank and validation