redo formatting + add an API