Move var definitions to top