Cleaned up codebase and test cases.