cleanup and scale fix