Refactor code
Add post type and post sub type