Moved tostr as internal method