Third attempt at trying to clean things up a bit more. Should be good
enough for now.