Extracted functions for better code readability