Refactor code in all previous tutorials.