move formatter to lib.