Move constant definitions to the scope where they are used
Remove code check warnings