some setup stuff and misc hacks that need to be cleaned up