cleaned up some code

I can remove the facts change if adrian does it in his branch.