Document and refactor model