Test cases and refactor code base
Test cases and refactor code base