made several code samples more consistent

and more generic, not that it mattered