fixed spec layout function to match new structure