Refactores test for users and functionaries