more unit tests and improved coverage