refactoring PostType and PostController