Rewritten from tests