Cleanup optimized methods. Add parameterized test cases to test both
standard and optimized methods.