finalize layout, remove useless stuffs