refactored some tests and code