update code style
extract methods