could we move this code to the separate function and just call it here - just for better readability