Refactored postmeta factory to use register_postmeta_types instead of switch