Refactor contents plugin