Improvement in TestOperations

-Remove function
-Reusing map value
-Pattern matching instead of instanceOf