lots of minor cleanup, some of the code was just embarrasing