Used reflection to call the code dynamically