cleanup, constants, initial format impl.