Included comments for refactoring the code