there we go. refactor's done.

the whole thing works now too.