Completed the simplify expression refactoring with more code to handle more cases and more test samples to cover it up.