Added utility functions and removed some logic i core class for the support for custom post type