refactor test and make things look nicer