Modify the code to be more convenient for testing 3 methods.