clean up layout and fix annoying build bugs