extract method for sorting sun ranges and move to utils