refactor into blogpost class