Refactor onContentPrepareForm