Added text template
Added text format
And more refactoring...