Refactored loop to get spines data