$ Extract some loop into private methods