refactor recursion in stringify method
add use strict