More tests with a hint of refactoring