Refactoring + comments.