refactor some elements for post types and meta