Remove code duplication and add comments for readability