Refactor and comments.