more tests, coverage, and refactoring
added more tests