nicer code

from jason talk