refatoring
added document start and end
create IFormatter and subclasses