refactored class names and packages. also added test cases