Reduced some of the sample_obj implementations to fewer statements.

Mostly by folding things into one expression; @gsilvis and myself both
agree that this is more readable.