refactor metadata tests