refactor test and make changes