refactor out code common to subject and comments