improved test coverage, cleaned up unused code