Declare functions at top-level