a little bit of cleanup and new functionality