Replaced ToString calls by format string.
Added generic read/write