Convert to one smart method to convert code to string