move definitions to top