Update refactoring, one test was incomplete but still passed
Further refactor on the code after review