Refactor tests, delete unused.