get content model from relationships, clean up code and add comment in the code.