Update some declarations
Implement local functions