Move rational to class and import