refactor the code layout.