fix some layout and code