refactored tests and methods