Extraction some code to helper