some cleanup and a few extra bits :)