cleanup and layout