fixed some tests
code cleanup
code cleanup