SourceFormatter - abstract logic into method