refactored post model