another implementation of to_rec to respect default record values