various cleanup, trying to properly integrate everything and tie it all together.