Restructuring and cleaning up example.