cleanup and flexlayout integration