Refactor and add comment - MOHAMMED