Fix Layout and Cleanup code