Could you add tests covering this code?