added postType; refactoring