minor refactor
added more test cases