refactoring the post model and views for validation