Encapsulate and make generally more awesome.

Signed-off-by: Peter Chester <peter@tri.be>