fix internal format / cleanups