Refactored tests, removed dead code