Moved variable declarations from layout into index