minor refactor and additional missing test