renamed joi* functions, simplified array handling