improve Ui tests

adding tear down
Code clean up

see #227