modify web page style and refactor code