move formatter to separate file