fix the scroll bar and refactor some
resolve merge conflict