layout and cleanup