Validation abstracted to its own class. Post repository updated to use new class.