refactor(layout): move variable into tighter scope